<template>
  <div>
    <lz-search ref="searchBar" :items="items" @search="search" @reset="reset"></lz-search>
    <a-button @click="getSearchValues">获取搜索参数</a-button>

    <a-button style="margin-left:10px;" @click="setSearchValues">设置值</a-button>

    <div>{{ searchValue }}</div>
  </div>
</template>
<script>
import items from "./items";
export default {
  data() {
    return {
      items,
      searchValue: {},
    };
  },
  created() {},
  mounted() {},
  methods: {
    reset(){
      console.log('重置搜索条件')
    },
    search(param) {
      this.searchValue = param;
    },
    getSearchValues() {
      this.searchValue = this.$refs.searchBar.getValues();
    },
    setSearchValues() {
      this.$refs.searchBar.setValues({
        title: "测试标题",
        state: 0,
        dates: ["2020-10-10", "2020-11-11"],
      });
    },
  },
};
</script>
<style></style>
